Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 17: Mapping Textures

../ch17/17fig12b.gif
Figure 17.12b

Six different wood types created by coloring a grayscale wood texture.

17fig12b.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
    # Top left
        Shape {
            appearance Appearance {
                material Material { diffuseColor 1.0 0.35 0.23 }
                texture DEF wood ImageTexture { url "wood_g.jpg" }
            }
            geometry DEF square IndexedFaceSet {
                coord Coordinate {
                    point [
                         0.0 1.0 0.0,  0.0 0.0 0.0,
                         1.1 0.0 0.0,  1.1 1.0 0.0
                    ]
                }
                coordIndex [ 0, 1, 2, 3 ]
            }
        },
    # Top center
        Transform {
            translation 1.25 0.0 0.0
            children Shape {
                appearance Appearance {
                    material Material { diffuseColor 1.0 0.45 0.23 }
                    texture USE wood
                }
                geometry USE square
            }
        },
    # Top right
        Transform {
            translation 2.50 0.0 0.0
            children Shape {
                appearance Appearance {
                    material Material { diffuseColor 1.0 0.55 0.23 }
                    texture USE wood
                }
                geometry USE square
            }
        },
    # Bottom left
        Transform {
            translation 0.0 -1.25 0.0
            children Shape {
                appearance Appearance {
                    material Material { diffuseColor 1.0 0.65 0.53 }
                    texture USE wood
                }
                geometry USE square
            }
        },
    # Bottom center
        Transform {
            translation 1.25 -1.25 0.0
            children Shape {
                appearance Appearance {
                    material Material { diffuseColor 1.0 0.55 0.43 }
                    texture USE wood
                }
                geometry USE square
            }
        },
    # Bottom right
        Transform {
            translation 2.50 -1.25 0.0
            children Shape {
                appearance Appearance {
                    material Material { diffuseColor 1.0 0.55 0.53 }
                    texture USE wood
                }
                geometry USE square
            }
        }
    ]
}